package com.atguigu.gulimail.product.web.config;

import io.lettuce.core.RedisClient;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RedissonConfig {

    /**
     * 所有对redisson的使用,都是通过容器中的RedissonClient对象
     * @return
     */
    @Bean(destroyMethod = "shutdown")
    RedissonClient redisson(){
        Config config= new Config();
        config.useSingleServer()
                .setAddress("redis://43.143.221.97:6379");
        return Redisson.create(config);

    }

}
